import React,{Component} from 'react';
import {
    StyleSheet,
    View,
    Button,
    TextInput
} from 'react-native'

export default class Page3 extends Component {
    static navigationOptions = ({navigation}) => {
        const {state} = navigation;
        const {params} = state;
        return {
            title: params.name
        }
    }
    render() {
        const {navigation} = this.props;
        const {setParams} = navigation;
        return (
            <View style = {styles.contriner}>
                <TextInput
                    style = {styles.input}
                    onChangeText = {text => {
                        setParams({name:text});
                    }}
                />
            </View>
        );
    }
}

const styles = StyleSheet.create({
    contriner: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',
    },
    input: {
        height: 45,
        width: 300,
        borderWidth: 1,
        borderColor: 'red',
    }
})